





<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Model Library Format &mdash; tvm 0.8.dev1982 文档</title>
  

  
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/gallery.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/tlcpack_theme.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../_static/tvm-logo-square.png"/>
  

  
  
  
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
        <script src="../_static/translations.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
    <script type="text/javascript" src="../_static/js/tlcpack_theme.js"></script>
    <link rel="index" title="索引" href="../genindex.html" />
    <link rel="search" title="搜索" href="../search.html" />
    <link rel="next" title="microTVM：裸机使用TVM" href="../topic/microtvm/index.html" />
    <link rel="prev" title="microTVM设计文档" href="microtvm_design.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    
<header class="header">
    <div class="innercontainer">
      <div class="headerInner d-flex justify-content-between align-items-center">
          <div class="headerLogo">
               <a href="https://tvm.apache.org/"><img src=https://tvm.apache.org/assets/images/logo.svg alt="logo"></a>
          </div>

          <div id="headMenu" class="headerNav">
            <button type="button" id="closeHeadMenu" class="navCloseBtn"><img src="../_static/img/close-icon.svg" alt="Close"></button>
             <ul class="nav">
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/community>Community</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/download>Download</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/vta>VTA</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/blog>Blog</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/docs>Docs</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvmconf.org>Conference</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://github.com/apache/tvm/>Github</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvmchinese.github.io/declaration_zh_CN.html>About-Translators</a>
                </li>
             </ul>
               <div class="responsivetlcdropdown">
                 <button type="button" class="btn-link">
                   ASF
                 </button>
                 <ul>
                     <li>
                       <a href=https://apache.org/>Apache Homepage</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/licenses/>License</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/security/>Security</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/thanks.html>Thanks</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/events/current-event>Events</a>
                     </li>
                     <li>
                       <a href=https://www.zhihu.com/column/c_1429578595417563136>Zhihu</a>
                     </li>
                 </ul>
               </div>
          </div>
            <div class="responsiveMenuIcon">
              <button type="button" id="menuBtn" class="btn-menu"><img src="../_static/img/menu-icon.svg" alt="Menu Icon"></button>
            </div>

            <div class="tlcDropdown">
              <div class="dropdown">
                <button type="button" class="btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  ASF
                </button>
                <div class="dropdown-menu dropdown-menu-right">
                  <ul>
                     <li>
                       <a href=https://apache.org/>Apache Homepage</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/licenses/>License</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/security/>Security</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/thanks.html>Thanks</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/events/current-event>Events</a>
                     </li>
                     <li>
                       <a href=https://www.zhihu.com/column/c_1429578595417563136>Zhihu</a>
                     </li>
                  </ul>
                </div>
              </div>
          </div>
       </div>
    </div>
 </header>
 
    <nav data-toggle="wy-nav-shift" class="wy-nav-side fixed">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html">
          

          
            
            <img src="../_static/tvm-logo-small.png" class="logo" alt="Logo"/>
          
          </a>

          
            
            
                <div class="version">
                  0.8.dev1982
                </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption" role="heading"><span class="caption-text">如何开始</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../install/index.html">安装 TVM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contribute/index.html">贡献者指南</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">用户引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../tutorial/index.html">User Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../how_to/index.html">How To Guides</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">开发者引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../dev/tutorial/index.html">Developer Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dev/how_to/how_to.html">开发者指南</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">架构指南</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Design and Architecture</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="index.html#example-compilation-flow">编译流程示例</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#logical-architecture-components">逻辑架构组件</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-support">tvm/support</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-runtime">tvm/runtime</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-node">tvm/node</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-ir">tvm/ir</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-target">tvm/target</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-tir">tvm/tir</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-arith">tvm/arith</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-te">tvm/te</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-topi">tvm/topi</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-relay">tvm/relay</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#tvm-autotvm">tvm/autotvm</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#frontends">Frontends</a></li>
<li class="toctree-l2"><a class="reference internal" href="index.html#security">安全</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html#microtvm">microTVM</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="microtvm_design.html">microTVM设计文档</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Model Library Format</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#about-model-library-format">About Model Library Format</a></li>
<li class="toctree-l4"><a class="reference internal" href="#what-can-be-exported">What can be Exported?</a></li>
<li class="toctree-l4"><a class="reference internal" href="#directory-layout">Directory Layout</a></li>
<li class="toctree-l4"><a class="reference internal" href="#description-of-sub-directories">Description of Sub-directories</a></li>
<li class="toctree-l4"><a class="reference internal" href="#metadata">Metadata</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">主题引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../topic/microtvm/index.html">microTVM：裸机使用TVM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../topic/vta/index.html">VTA: Versatile Tensor Accelerator</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">参考指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../reference/langref/index.html">语言参考</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/api/python/index.html">Python API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/api/links.html">Other APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/publications.html">Publications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../genindex.html">索引</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
      
      <nav class="wy-nav-top" aria-label="top navigation" data-toggle="wy-nav-top">
        
            <div class="togglemenu">

            </div>
            <div class="nav-content">
              <!-- tvm -->
              Table of content
            </div>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        

          




















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html">Docs</a> <span class="br-arrow">></span></li>
        
          <li><a href="index.html">Design and Architecture</a> <span class="br-arrow">></span></li>
        
      <li>Model Library Format</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/arch/model_library_format.rst.txt" rel="nofollow"> <img src="../_static//img/source.svg" alt="viewsource"/></a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="model-library-format">
<h1>Model Library Format<a class="headerlink" href="#model-library-format" title="永久链接至标题">¶</a></h1>
<div class="section" id="about-model-library-format">
<h2>About Model Library Format<a class="headerlink" href="#about-model-library-format" title="永久链接至标题">¶</a></h2>
<p>TVM traditionally exports generated libraries as Dynamic Shared Objects (e.g. DLLs (Windows) or .so
(linux)). Inferences can be performed using those libraries by loading them into an executable using
<code class="docutils literal notranslate"><span class="pre">libtvm_runtime.so</span></code>. This process is very dependent on services provided by traditional OS.</p>
<p>For deployment to unconventional platforms (e.g. those lacking traditional OS), TVM provides another
output format, Model Library Format. Initially, the microTVM project is the primary use case for this
format. Should it become useful in other use cases (and in particular, should it become possible to
export BYOC artifacts in Model Library Format), it could be used as a general-purpose TVM export
format.  Model Library Format is a tarball containing a file for each piece of the TVM compiler
output.</p>
</div>
<div class="section" id="what-can-be-exported">
<h2>What can be Exported?<a class="headerlink" href="#what-can-be-exported" title="永久链接至标题">¶</a></h2>
<p>At the time of writing, export is limited to full models built with <code class="docutils literal notranslate"><span class="pre">tvm.relay.build</span></code>.</p>
</div>
<div class="section" id="directory-layout">
<h2>Directory Layout<a class="headerlink" href="#directory-layout" title="永久链接至标题">¶</a></h2>
<p>Model Library Format is contained within a tarball. All paths are relative to the root of the
tarball:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">/</span></code> - Root of the tarball</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">codegen</span></code> - Root directory for all generated device code</p>
<ul>
<li><p>(see <a class="reference internal" href="#codegen">codegen</a> section)</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">executor-config/</span></code> - Configuration for the executor which drives model inference</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">graph/</span></code> - Root directory containing configuration for the GraphExecutor</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">graph.json</span></code> - GraphExecutor JSON configuration</p></li>
</ul>
</li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">metadata.json</span></code> - Machine-parseable metadata for this model</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">parameters/</span></code> - Root directory where simplified parameters are placed</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">&lt;model_name&gt;.params</span></code> - Parameters for the model tvm.relay._save_params format</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">src/</span></code> - Root directory for all source code consumed by TVM</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">relay.txt</span></code> - Relay source code for the generated model</p></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="description-of-sub-directories">
<h2>Description of Sub-directories<a class="headerlink" href="#description-of-sub-directories" title="永久链接至标题">¶</a></h2>
<div class="section" id="codegen">
<span id="subdir-codegen"></span><h3><code class="docutils literal notranslate"><span class="pre">codegen</span></code><a class="headerlink" href="#codegen" title="永久链接至标题">¶</a></h3>
<p>All TVM-generated code is placed in this directory. At the time of writing, there is 1 file per
Module in the generated Module tree, though this restriction may change in the future. Files in
this directory should have filenames of the form <code class="docutils literal notranslate"><span class="pre">&lt;target&gt;/(lib|src)/&lt;unique_name&gt;.&lt;format&gt;</span></code>.</p>
<p>These components are described below:</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">&lt;target&gt;</span></code> - Identifies the TVM target on which the code should run. Currently, only <code class="docutils literal notranslate"><span class="pre">host</span></code>
is supported.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">&lt;unique_name&gt;</span></code> - A unique slug identifying this file. Currently <code class="docutils literal notranslate"><span class="pre">lib&lt;n&gt;</span></code>, with <code class="docutils literal notranslate"><span class="pre">&lt;n&gt;&gt;</span></code> an
auto-incrementing integer.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">&lt;format&gt;</span></code> - Suffix identifying the filename format. Currently <code class="docutils literal notranslate"><span class="pre">c</span></code> or <code class="docutils literal notranslate"><span class="pre">o</span></code>.</p></li>
</ul>
</div></blockquote>
<p>An example directory tree for a CPU-only model is shown below:</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">codegen/</span></code> - Codegen directory</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">host/</span></code> - Generated code for <code class="docutils literal notranslate"><span class="pre">target_host</span></code></p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">lib/</span></code> - Generated binary object files</p></li>
</ul>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">lib0.o</span></code> - LLVM module (if <code class="docutils literal notranslate"><span class="pre">llvm</span></code> target is used)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">lib1.o</span></code> - LLVM CRT Metadata Module (if <code class="docutils literal notranslate"><span class="pre">llvm</span></code> target is used)</p></li>
</ul>
</div></blockquote>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">src/</span></code> - Generated C source</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">lib0.c</span></code> - C module (if <code class="docutils literal notranslate"><span class="pre">c</span></code> target is used)</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">lib1.c</span></code> - C CRT Metadata module (if <code class="docutils literal notranslate"><span class="pre">c</span></code> target is used)</p></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="executor-config">
<h3><code class="docutils literal notranslate"><span class="pre">executor-config</span></code><a class="headerlink" href="#executor-config" title="永久链接至标题">¶</a></h3>
<p>Contains machine-parsable configuration for executors which can drive model inference. Currently,
only the GraphExecutor produces configuration for this directory, in <code class="docutils literal notranslate"><span class="pre">graph/graph.json</span></code>. This
file should be read in and the resulting string supplied to the <code class="docutils literal notranslate"><span class="pre">GraphExecutor()</span></code> constructor for
parsing.</p>
</div>
<div class="section" id="parameters">
<h3><code class="docutils literal notranslate"><span class="pre">parameters</span></code><a class="headerlink" href="#parameters" title="永久链接至标题">¶</a></h3>
<p>Contains machine-parseable parameters. A variety of formats may be provided, but at present, only
the format produced by <code class="docutils literal notranslate"><span class="pre">tvm.relay._save_params</span></code> is supplied. When building with
<code class="docutils literal notranslate"><span class="pre">tvm.relay.build</span></code>,  the <code class="docutils literal notranslate"><span class="pre">name</span></code> parameter is considered to be the model name. A single file is
created in this directory <code class="docutils literal notranslate"><span class="pre">&lt;model_name&gt;.json</span></code>.</p>
</div>
<div class="section" id="src">
<h3><code class="docutils literal notranslate"><span class="pre">src</span></code><a class="headerlink" href="#src" title="永久链接至标题">¶</a></h3>
<p>Contains source code parsed by TVM. Currently, just the Relay source code is created in
<code class="docutils literal notranslate"><span class="pre">src/relay.txt</span></code>.</p>
</div>
</div>
<div class="section" id="metadata">
<h2>Metadata<a class="headerlink" href="#metadata" title="永久链接至标题">¶</a></h2>
<p>Machine-parseable metadata is placed in a file <code class="docutils literal notranslate"><span class="pre">metadata.json</span></code> at the root of the tarball.
Metadata is a dictionary with these keys:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">export_datetime</span></code>: Timestamp when this Model Library Format was generated, in
<a class="reference external" href="https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior">strftime</a>
format <code class="docutils literal notranslate"><span class="pre">&quot;%Y-%M-%d</span> <span class="pre">%H:%M:%SZ&quot;,</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">memory</span></code>: A summary of the memory usage of each generated function. Documented in
<a class="reference internal" href="#memory-usage-summary">Memory Usage Summary</a>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">model_name</span></code>: The name of this model (e.g. the <code class="docutils literal notranslate"><span class="pre">name</span></code> parameter supplied to
<code class="docutils literal notranslate"><span class="pre">tvm.relay.build</span></code>).</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">executors</span></code>: A list of executors supported by this model. Currently, this list is always
<code class="docutils literal notranslate"><span class="pre">[&quot;graph&quot;]</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">target</span></code>: A dictionary mapping <code class="docutils literal notranslate"><span class="pre">device_type</span></code> (the underlying integer, as a string) to the
sub-target which describes that relay backend used for that <code class="docutils literal notranslate"><span class="pre">device_type</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">version</span></code>: A numeric version number that identifies the format used in this Model Library
Format. This number is incremented when the metadata structure or on-disk structure changes.
This document reflects version <code class="docutils literal notranslate"><span class="pre">5</span></code>.</p></li>
</ul>
<div class="section" id="memory-usage-summary">
<h3>Memory Usage Summary<a class="headerlink" href="#memory-usage-summary" title="永久链接至标题">¶</a></h3>
<p>A dictionary with these sub-keys:</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">&quot;main&quot;</span></code>: <code class="docutils literal notranslate"><span class="pre">list[MainFunctionWorkspaceUsage]</span></code>. A list summarizing memory usage for each
workspace used by the main function and all sub-functions invoked.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">&quot;operator_functions&quot;</span></code>: <code class="docutils literal notranslate"><span class="pre">map[string,</span> <span class="pre">list[FunctionWorkspaceUsage]]</span></code>. Maps operator function
name to a list summarizing memory usage for each workpace used by the function.</p></li>
</ul>
</div></blockquote>
<p>A <code class="docutils literal notranslate"><span class="pre">MainFunctionWorkspaceUsage</span></code> is a dict with these keys:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">&quot;device&quot;</span></code>: <code class="docutils literal notranslate"><span class="pre">int</span></code>. The <code class="docutils literal notranslate"><span class="pre">device_type</span></code> associated with this workspace.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">&quot;workspace_size_bytes&quot;</span></code>: <code class="docutils literal notranslate"><span class="pre">int</span></code>. Number of bytes needed in this workspace by this function
and all sub-functions invoked.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">&quot;constants_size_bytes&quot;</span></code>: <code class="docutils literal notranslate"><span class="pre">int</span></code>. Size of the constants used by the main function.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">&quot;io_size_bytes&quot;</span></code>: <code class="docutils literal notranslate"><span class="pre">int</span></code>. Sum of the sizes of the buffers used from this workspace by this
function and sub-functions.</p></li>
</ul>
<p>A <code class="docutils literal notranslate"><span class="pre">FunctionWorkspaceUsage</span></code> is a dict with these keys:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">&quot;device&quot;</span></code>: <code class="docutils literal notranslate"><span class="pre">int</span></code>. The <code class="docutils literal notranslate"><span class="pre">device_type</span></code> associated with this workspace.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">&quot;workspace_size_bytes&quot;</span></code>: <code class="docutils literal notranslate"><span class="pre">int</span></code>. Number of bytes needed in this workspace by this function.</p></li>
</ul>
</div>
</div>
</div>


           </div>
           
          </div>
          

<footer>

    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../topic/microtvm/index.html" class="btn btn-neutral float-right" title="microTVM：裸机使用TVM" accesskey="n" rel="next">下一个 <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="microtvm_design.html" class="btn btn-neutral float-left" title="microTVM设计文档" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一个</a>
      
    </div>

<div id="button" class="backtop"><img src="../_static//img/right.svg" alt="backtop"/> </div>
<section class="footerSec">
    <div class="footerHeader">
      <ul class="d-flex align-md-items-center justify-content-between flex-column flex-md-row">
        <li class="copywrite d-flex align-items-center">
          <h5 id="copy-right-info">© 2020 Apache Software Foundation | All right reserved</h5>
        </li>
      </ul>

    </div>

    <ul>
      <li class="footernote">Copyright © 2020 The Apache Software Foundation. Apache TVM, Apache, the Apache feather, and the Apache TVM project logo are either trademarks or registered trademarks of the Apache Software Foundation.</li>
    </ul>

</section>
</footer>
        </div>
      </div>

    </section>

  </div>
  

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

  </body>
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
    <!-- Theme Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-75982049-2', 'auto');
    ga('send', 'pageview');
    </script>

    
   

</body>
</html>